re-enable JIT for ZTS builds on Apple Silicon#22712
Conversation
|
I don't know if this was in response to my mail, but thank you 😄 |
Actually yes, haha. I knew that this should work, I just was not working on it and then reading your mail reminded me of it 👍 |
arnaud-lb
left a comment
There was a problem hiding this comment.
Looks good to me otherwise!
|
Thank you @realFlowControl! |
Related: phpGH-22712 Co-authored-by: Florian Engelhardt <florian.engelhardt@datadoghq.com>
|
This change is problematic for CI. I.e. it makes all the tests with an explicit Normally opcache would just log something with |
Ah I see. Yeah I think that should work, I have a look and keep you posted. |
Fixes #13400
For
__APPLE__ && __aarch64__ && ZTS, this PR moves the JIT buffer out of the OPcache shared memory and creates a dedicated mapping.Background
OPcache JIT is currently disabled for ZTS builds on Apple Silicon. The JIT buffer normally lives at the end of OPcache's
MAP_SHARED | MAP_ANONallocation. In ZTS, one thread may generate code while another executes existing code, so the buffer must remain executable while it is writable.Apple Silicon rejects RWX anonymous mappings with
EPERM. Apple's supported solution isMAP_JITwithpthread_jit_write_protect_np(), which provides per-thread write protection, but macOS rejectsMAP_JIT | MAP_SHAREDwithEINVAL. The existing combined OPcache/JIT mapping won't work on Apple Silicon.